using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

namespace Wax.Runner
{
    public partial class ExceptionDialog : Form
    {
        /// <summary>
        /// The exception to display in this dialog
        /// </summary>
        private TestError testError;

        /// <summary>
        /// Initializes a new instance of the <see cref="ExceptionDialog"/> class.
        /// </summary>
        /// <param name="testError">The test error.</param>
        public ExceptionDialog(TestError testError)
        {
            this.testError = testError;

            InitializeComponent();

            InitializeControls();
        }

        /// <summary>
        /// Initializes the controls.
        /// </summary>
        private void InitializeControls()
        {
            this.Text = string.Format("Test {0} in command {1} exception details.", this.testError.Test.Id, this.testError.Command.Id);
            this.exceptionTextBox.Text = this.testError.Exception.ToString();
        }
    }
}